package Sort;

import org.junit.Assert;
import org.junit.Test;

/**
 * @Author: ylc
 * @Description:
 * @Date Created in 2022-04-21 19:38
 */
public class SortTest {
    int[] array = {3, 5, 7, 2, 1, 4, 3, 6};
    int[] ans = {1, 2, 3, 3, 4, 5, 6, 7 };

    @Test
    public void TestBubbleSort(){
        Sort.bubbleSort(array);
        Assert.assertArrayEquals(ans,array);
    }
    @Test
    public void TestSelectSort(){
        Sort.selectSort(array);
        Assert.assertArrayEquals(ans,array);
    }
    @Test
    public void TestSelectSortOP(){
        Sort.selectSortOP(array);
        Assert.assertArrayEquals(ans,array);
    }
    @Test
    public void TestInsertSort(){
        Sort.insertSort(array);
        Assert.assertArrayEquals(ans,array);
    }
    @Test
    public void TestInsertSortBS(){
        Sort.insertSortBS(array);
        Assert.assertArrayEquals(ans,array);
    }
    @Test
    public void TestHeapSort(){
        Sort.heapSort(array);
        Assert.assertArrayEquals(ans,array);
    }
    @Test
    public void TestMergeSort(){
        Sort.mergeSort(array);
        Assert.assertArrayEquals(ans,array);
    }


}
